package com.jingtai.platform.controller.admin;

import com.jingtai.core.entity.admin.PlatformSeeting;
import com.jingtai.platform.service.admin.PlatformSeetingService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 平台设置表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/platformseeting")
@Api(tags = "平台设置表")
public class PlatformSeetingController{

    @Autowired
    private PlatformSeetingService platformSeetingService;


    @ApiOperation("平台设置表列表查询")
    @GetMapping("/list")
    public ResultUtil aopPlatformSeetingList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return platformSeetingService.PlatformSeetinglist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询platformSeeting实体")
    @GetMapping("/getPlatformSeetingById")
    public ResultUtil GetPlatformSeetingById(@CApiParam(name = "id",value = "platformSeeting实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return platformSeetingService.getPlatformSeetingById(id);
    }


    @ApiOperation("新增platformSeeting实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"platformSeeting.id","platformSeeting.createTime","platformSeeting.updateTime","platformSeeting.deleteFlag"})
    public ResultUtil aopAddPlatformSeeting(@RequestBody @Validated PlatformSeeting platformSeeting){
        return platformSeetingService.addPlatformSeeting(platformSeeting);
    }

    @ApiOperation("编辑platformSeeting实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"platformSeeting.createTime","platformSeeting.updateTime","platformSeeting.deleteFlag"})
    public ResultUtil aopEditPlatformSeeting(@RequestBody @Validated PlatformSeeting platformSeeting){
        return platformSeetingService.editPlatformSeeting(platformSeeting);
    }

    @ApiOperation("根据ID删除platformSeeting实体")
    @GetMapping("/delPlatformSeetingById")
    public ResultUtil aopDelPlatformSeetingById(@CApiParam(name = "id",value = "platformSeeting实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return platformSeetingService.delPlatformSeetingById(id);
    }

}






